<!-- FILE:templates/logs/service.html -->
<!--Body content-->


<div id="content" class="clearfix">
    <div class="contentwrapper"><!--Content wrapper-->

        <div class="heading">

            <h3>Log Viewer</h3>                    

            <div class="resBtnSearch">
                <a href="#"><span class="icon16 icomoon-icon-search-3"></span></a>
            </div>

        </div><!-- End .heading-->

        <!-- Build page from here: -->
        <div class="row-fluid">
          <div class="offset1 span8">
            <div class="page-header">
              <h1>View {{ service_name }} logs on {{ host }}:</h1>
            </div><!--close header-->
          <table id="log_table" class="table table-striped table-bordered">
            <tr>
              <th class="log_title">Time</th>
              <th class="log_title">Log Level</th>
              <th class="log_title">Log Message</th>
            </tr>
            {% for line in query %}
              {% for app_log in line.app_logs %}
              <tr>
              <td style="width:160px;">{{ app_log.timestamp }}</td>
              <td id="log_width"
              {% if app_log.level == 1 %}
                style="background-color: #dff0d8;"
              {% elif app_log.level == 2 %}
                style="background-color: #d9edf7;"
              {% elif app_log.level == 3 %}
                style="background-color: #fcf8e3;"
              {% else %}
                style="background-color: #f2dede;"
              {% endif %}
                >
                {% if app_log.level == 1 %}
                  DEBUG <span aria-hidden="true" class="icomoon-icon-bug"></span>
                {% elif app_log.level == 2 %}
                  INFO <span aria-hidden="true" class="icomoon-icon-search-3"></span>
                {% elif app_log.level == 3 %}
                  WARN <span aria-hidden="true" class="icomoon-icon-warning"></span>
                {% elif app_log.level == 4 %}
                  ERROR <span aria-hidden="true" class="icomoon-icon-cancel"></span>
                {% elif app_log.level == 5 %}
                  CRITICAL <span aria-hidden="true" class="icomoon-icon-fire-2"></span>
                {% else %}
                  UNKNOWN <span aria-hidden="true" class="typ-icon-question"></span>
                {% endif %}
              </td>
              <td style="font-size:15px;float:left;text-align:left;"><strong>{{ app_log.message.replace('\n', '<br />') }}</strong></td>
              </tr>
              {% endfor %}
            {% endfor %}
          </table>
              <a class="btn" href="/logs/{{service_name}}/{{host}}">View Newest</a>
          {% if is_more %}
            <a class="btn btn-success pull-right" href="/logs/{{service_name}}/{{host}}?next_cursor={{next_cursor}}">Next 10</a>
          {% endif %}
          </div><!--close span6 -->
        <div class="span3"></div> <!--spacing div-->
        </div> <!-- end row fluid -->
    </div> <!-- end content wrapper -->
</div> <!--end content-->
